package com.android.delivery.activity

import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import com.android.delivery.R
import com.android.delivery.activity.fragment.PeiSendListFragment
import com.android.delivery.adapter.BaseFragmentStateAdapter
import com.android.delivery.base.BaseActivity
import kotlinx.android.synthetic.main.common_viewpager.*

/**
 * @author: mqwang
 * @create: 3/21/21 8:49 AM
 * @Description: 揽件中心
 */
class PeiSongZhongXinActivity : BaseActivity() {

    private val mTitles: MutableList<String> = ArrayList()
    private val tabFragmentList: MutableList<Fragment> = ArrayList()

    override fun getLayoutId(): Int {
        return R.layout.common_viewpager
    }

    override fun init(savedInstanceState: Bundle?, container: View?) {
        setMainTitle("配送中心")

        mTitles.add("未完成")
        mTitles.add("已完成")

        tabFragmentList.add(PeiSendListFragment.newInstance(0))
        tabFragmentList.add(PeiSendListFragment.newInstance(1))

        view_pager.setAdapter(BaseFragmentStateAdapter(supportFragmentManager, tabFragmentList, mTitles))
        tab_layout.setupWithViewPager(view_pager) //此方法就是让tablayout和ViewPager联动

    }
}